<div class="fly-panel detail-box" id="flyReply" style="padding:10px">
    <a name="comment"> </a>
    <input type="hidden" value="4" id="type" />

    <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
        <legend>评论</legend>
    </fieldset>
    <div class="layui-form layui-form-pane">
        <form>
            <div class="layui-form-item layui-form-text">
                <div class="layui-input-block">
                    <span id="huifu"></span>
                    <textarea id="content" name="content" lay-verify="content" class="layui-textarea"  placeholder="既然来了，何不留下你的足迹？"></textarea>
                    <input type="hidden" name="tid" value="0" id="tid" />
                </div>
            </div>
            <div class="layui-form-item" style="text-align:right">
                <button class="layui-btn layui-bg-blue" lay-submit="" lay-filter="comment_add" data-url="{:url('index/artcomment/add',array('id'=>$t.id))}">提交评论</button>
            </div>
        </form>
    </div>
    <ul class="jieda" id="jieda">
        {volist name="tptc" id="vo"}
        <li id="tpt{$vo.id}" class="jieda-daan">

            <div class="detail-about detail-about-reply">
                <a class="fly-avatar" href="{:url('user/index/home',array('id'=>$vo.userid))}">
                    <img src="__ROOT__{$vo.userhead}" alt="{$vo.username}" /> </a>
                <div class="fly-detail-user">
                    <a href="{:url('user/index/home',array('id'=>$vo.userid))}" class="fly-link">
                        <cite class="username">{if condition="$vo['uid'] eq session('userid')"}我{else /}{$vo.username}{/if} {if condition="$vo['uid'] eq $t['userid']"} [作者]{/if}</cite>
                    </a>
                    <!-- <span style="color:#5FB878">(管理员)</span>  -->
                </div>
                <div class="detail-hits">
                    <span>{$vo.time|friendlyDate}</span>
                </div>
                <i class="iconfont icon-caina" style="display:none" title="最佳答案"></i>
            </div>

            {if condition="$vo['reply_open'] neq 0"}
            <div class="detail-body jieda-body">
               <p> {if $vo['reply'] eq 1}[回复]{/if} {$vo.content|htmlspecialchars_decode}</p>
              

            </div>
        
            <div class="jieda-reply">

                <span class="jieda-zan {if in_array($vo['id'],$commentzan)}zanok{/if}" data-id="{$vo.id}" data-url="{:url('index/api/zan_collect')}" type="zan">
    <i class="iconfont icon-zan"></i>
    <em>{$vo.zan}</em>
  </span> {if condition="$vo['uid'] neq session('userid')"}
              
                <span class="reply" data-id="{$vo.id}">
    <i class="iconfont icon-svgmoban53"></i>
    回复</span> {/if} {if condition="$isbanzhu || $vo['uid'] eq session('userid')"}

                <span type="edit"><a style="color:#999" data-id="{$vo.id}" data-url="{:url('index/articles/delcomment')}" class="del_btn"> <i class="iconfont icon-guanbi"></i>删除</a></span> {/if}{if condition="$isbanzhu eq 1 && session('userid')
                neq $vo.uid"}
                <span type="edit"><a style="color:#999" data-id="{$vo.id}" data-url="{:url('bbs/forum/gaguser')}" class="jinyan_btn">  <img src="__HOME__/images/gag.png" width="20">禁言</a></span>{/if}
            
            
            </div>
            {else /}
            <div class="detail-body jieda-body hidecontent">
                留言审核中……
            </div>
            {/if}
        </li>
        {/volist}

    </ul>
    <div class="pages">{$tptc->render()}</div>
    <div style="text-align: center">
    </div>
</div>
<script src="__PUBLIC__/js/thread.js"></script>
<script>

    layui.use(['form'], function() {
           var jq=layui.jquery;
           jq(".reply").on('click',function(){
               var id=jq(this).data('id');
               var fid="{$t.id}";
              
            layer.prompt({title: '输入回复内容', formType: 2}, function(content, index){
                var url = '{:url("index/artcomment/reply")}';

                $.post(url, {tid:id,content:content,fid:fid}, function(data) {

                   if (data.code == 200) {
              
                 layer.msg(data.msg, {
                     icon: 1,
                     time: 1000
                 }, function() {
                     location.reload();
                 });
             } else {
                
                 layer.msg(data.msg, {
                     icon: 2,
                     anim: 6,
                     time: 1000
                 });
             }

                });   
             });
           });
    });
    </script>